const http = uni.$u.http

export default {
  /**
   * 小程序登录与用户信息
   */
  login: (data) => http.post('/api/mini/login', data),
  bindStudent: (data) => http.post('/api/mini/bindStudent', data),
  getUserInfo: (data) => http.get('/api/mini/getUserInfo', data),
  
  /**
   * 首页相关
   */
  getCarousels: () => http.get('/api/mini/carousels'),
  getNewsList: (data) => http.get('/api/mini/news', data),
  getNewsDetail: (data) => http.get('/api/mini/newsDetail', data),
  
  /**
   * 预约相关
   */
  getSchools: () => http.get('/api/mini/schools'),
  getLibraries: (data) => http.get('/api/mini/libraries', data),
  getLibraryDetail: (data) => http.get('/api/mini/libraryDetail', data),
  getFloors: (data) => http.get('/api/mini/floors', data),
  getAreas: (data) => http.get('/api/mini/areas', data),
  getSeats: (data) => http.get('/api/mini/seats', data),
  reserve: (data) => http.post('/api/mini/reserve', data),
  
  /**
   * 预约记录相关
   */
  getReservations: (data) => http.get('/api/mini/reservations', data),
  checkIn: (data) => http.post('/api/mini/checkIn', data),
  checkOut: (data) => http.post('/api/mini/checkOut', data),
  cancelReservation: (data) => http.post('/api/mini/cancelReservation', data),
  
  /**
   * 政策配置
   */
  getPolicyList: (data) => http.get('/core/agreement-config/listByType', data),
  getPolicyDetail: (data) => http.get('/core/agreement-config/get', data),
}
